﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Selector - Val</title>
    <script src="script/jquery-1.3.2.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            $("select").change(displayVals);
            displayVals(); 
        });

        function displayVals() {
            var singleValues = $("#single").val();
            $("#nilai").val(singleValues);
            $("p").html("<b>Single:</b> " + singleValues);
        }
    </script>
</head>
<body>
    <p></p>
    <select id="single"> 
        <option>Single</option> 
        <option>Single2</option> 
    </select>
    <input type="text" id="nilai" />
</body>
</html>
